
<!DOCTYPE HTML>
<html lang="zh-hans" >
    <head>
        <meta charset="UTF-8">
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
        <title>3.1.1 原理及构成 · Ebook</title>
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <meta name="description" content="">
        <meta name="generator" content="GitBook 3.2.3">
        <meta name="author" content="zq_sdk@163.com">
        
        
    
    <link rel="stylesheet" href="../../gitbook/style.css">

    
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-disqus/plugin.css">
                
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-tree/plugin.css">
                
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-splitter/splitter.css">
                
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-local-video/video-js.min.css">
                
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-tbfed-pagefooter/footer.css">
                
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-ace/ace.css">
                
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-katex/katex.min.css">
                
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-highlight/website.css">
                
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-search/search.css">
                
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-fontsettings/website.css">
                
            
        

    

    
        
    
        
    
        
    
        
    
        
    
        
    

        
    
    
    
    
    <meta name="HandheldFriendly" content="true"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <link rel="apple-touch-icon-precomposed" sizes="152x152" href="../../gitbook/images/apple-touch-icon-precomposed-152.png">
    <link rel="shortcut icon" href="../../gitbook/images/favicon.ico" type="image/x-icon">

    
    <link rel="next" href="async.html" />
    
    
    <link rel="prev" href="node.html" />
    

    <style>
    @media only screen and (max-width: 640px) {
        .book-header .hidden-mobile {
            display: none;
        }
    }
    </style>
    <script>
        window["gitbook-plugin-github-buttons"] = {"repo":"TIME-GATE/","types":["star","watch"],"size":"large"};
    </script>

    
    <link rel="stylesheet" href="../../gitbook/gitbook-plugin-chart/c3/c3.min.css">
    <script src="../../gitbook/gitbook-plugin-chart/c3/d3.min.js"></script>
    <script src="../../gitbook/gitbook-plugin-chart/c3/c3.min.js"></script>
    

    </head>
    <body>
        
<div class="book">
    <div class="book-summary">
        
            
<div id="book-search-input" role="search">
    <input type="text" placeholder="输入并搜索" />
</div>

            
                <nav role="navigation">
                


<ul class="summary">
    
    

    

    
        
        
    
        <li class="chapter " data-level="1.1" data-path="../../">
            
                <a href="../../">
            
                    
                    简介
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.1.1" data-path="../../about_me.html">
            
                <a href="../../about_me.html">
            
                    
                    关于
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.1.2" data-path="../../gitbook_install.html">
            
                <a href="../../gitbook_install.html">
            
                    
                    附:Gitbook安装
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.2" data-path="../../">
            
                <a href="../../">
            
                    
                    一 基础理论
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.2.1" data-path="../../data_structure/">
            
                <a href="../../data_structure/">
            
                    
                    1 数据结构
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.2.1.1" data-path="../../data_structure/11_linear_structure.html">
            
                <a href="../../data_structure/11_linear_structure.html">
            
                    
                    1.1 数组、链表、跳表及字典
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.2.1.1.1" data-path="../../data_structure/111_array.html">
            
                <a href="../../data_structure/111_array.html">
            
                    
                    1.1.1 数组
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.1.1.2" data-path="../../data_structure/112_link_list.html">
            
                <a href="../../data_structure/112_link_list.html">
            
                    
                    1.1.2 链表
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.1.1.3" data-path="../../data_structure/113_skip_list.html">
            
                <a href="../../data_structure/113_skip_list.html">
            
                    
                    1.1.3 跳表
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.1.1.4" data-path="../../data_structure/114_dictionary.html">
            
                <a href="../../data_structure/114_dictionary.html">
            
                    
                    1.1.4 字典
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.2.1.2" data-path="../../data_structure/12_stack_and_queue.html">
            
                <a href="../../data_structure/12_stack_and_queue.html">
            
                    
                    1.2 栈、队列、散列及集合
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.2.1.2.1" data-path="../../data_structure/121_stack.html">
            
                <a href="../../data_structure/121_stack.html">
            
                    
                    1.2.1 栈
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.1.2.2" data-path="../../data_structure/122_queue.html">
            
                <a href="../../data_structure/122_queue.html">
            
                    
                    1.2.2 队列
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.1.2.3" data-path="../../data_structure/123_hash.html">
            
                <a href="../../data_structure/123_hash.html">
            
                    
                    1.2.3 散列
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.1.2.4" data-path="../../data_structure/124_set.html">
            
                <a href="../../data_structure/124_set.html">
            
                    
                    1.2.4 集合
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.2.1.3" data-path="../../data_structure/13_tree_and_forest.html">
            
                <a href="../../data_structure/13_tree_and_forest.html">
            
                    
                    1.3 树与森林
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.2.1.3.1" data-path="../../data_structure/131.html">
            
                <a href="../../data_structure/131.html">
            
                    
                    1.3.1 二叉搜索树
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.1.3.2" data-path="../../data_structure/132.html">
            
                <a href="../../data_structure/132.html">
            
                    
                    1.3.2 红黑树
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.2.1.4" data-path="../../data_structure/14_map.html">
            
                <a href="../../data_structure/14_map.html">
            
                    
                    1.4 图结构
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.2.1.4.1" data-path="../../data_structure/141_minimal_tree.html">
            
                <a href="../../data_structure/141_minimal_tree.html">
            
                    
                    1.4.1 最小生成树
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.1.4.2" data-path="../../data_structure/142_single_source_shortest_path.html">
            
                <a href="../../data_structure/142_single_source_shortest_path.html">
            
                    
                    1.4.2 单源最短路径
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.1.4.3" data-path="../../data_structure/143_all_source_shortest_path.html">
            
                <a href="../../data_structure/143_all_source_shortest_path.html">
            
                    
                    1.4.3 多源最短路径
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.1.4.4" data-path="../../data_structure/144_max_stream.html">
            
                <a href="../../data_structure/144_max_stream.html">
            
                    
                    1.4.4 最大流
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.2.2" data-path="../../">
            
                <a href="../../">
            
                    
                    2 基础算法
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.2.2.1" data-path="../../algorithm/21.html">
            
                <a href="../../algorithm/21.html">
            
                    
                    2.1 排序查找
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.2.2" data-path="../../algorithm/22.html">
            
                <a href="../../algorithm/22.html">
            
                    
                    2.2 动态规划
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.2.3" data-path="../../algorithm/distributed_algorithm.html">
            
                <a href="../../algorithm/distributed_algorithm.html">
            
                    
                    3 分布式算法
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.2.3.1" data-path="../../engineering/ci_deplopment/cs/theory.html">
            
                <a href="../../engineering/ci_deplopment/cs/theory.html">
            
                    
                    3.1 一致性模式与理论
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.3.2" data-path="../../algorithm/raft.html">
            
                <a href="../../algorithm/raft.html">
            
                    
                    3.2 Raft协议
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.3.3" data-path="../../algorithm/paxos.html">
            
                <a href="../../algorithm/paxos.html">
            
                    
                    3.3 Paxos协议
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.3.4" data-path="../../algorithm/gossip.html">
            
                <a href="../../algorithm/gossip.html">
            
                    
                    3.4 Gossip协议
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.3.5" data-path="../../engineering/ci_deplopment/cs/plan.html">
            
                <a href="../../engineering/ci_deplopment/cs/plan.html">
            
                    
                    3.5 几种一致性方案
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.2.4" data-path="../../optimization_se/">
            
                <a href="../../optimization_se/">
            
                    
                    4 运筹及系统工程
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.2.4.1" data-path="../../optimization_se/linear_programming.html">
            
                <a href="../../optimization_se/linear_programming.html">
            
                    
                    4.1 线性规划
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.4.2" data-path="../../optimization_se/integer_programming.html">
            
                <a href="../../optimization_se/integer_programming.html">
            
                    
                    4.2 整数规划
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.4.3" data-path="../../optimization_se/目标规划.html">
            
                <a href="../../optimization_se/目标规划.html">
            
                    
                    4.3 目标规划
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.4.4" data-path="../../optimization_se/非线性规划.html">
            
                <a href="../../optimization_se/非线性规划.html">
            
                    
                    4.4 非线性规划
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.4.5" data-path="../../optimization_se/动态规划.html">
            
                <a href="../../optimization_se/动态规划.html">
            
                    
                    4.5 动态规划
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.4.6" data-path="../../optimization_se/排队论.html">
            
                <a href="../../optimization_se/排队论.html">
            
                    
                    4.6 排队论
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.4.7" data-path="../../optimization_se/博弈论.html">
            
                <a href="../../optimization_se/博弈论.html">
            
                    
                    4.7 博弈论
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.3" >
            
                <span>
            
                    
                    二 工程应用
            
                </span>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.3.1" data-path="../../engineering/design_pattern/">
            
                <a href="../../engineering/design_pattern/">
            
                    
                    1 设计模式
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.3.1.1" data-path="../../engineering/design_pattern/strategy.html">
            
                <a href="../../engineering/design_pattern/strategy.html">
            
                    
                    1.1 策略模式
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.1.2" data-path="../../engineering/design_pattern/prototype.html">
            
                <a href="../../engineering/design_pattern/prototype.html">
            
                    
                    1.2 原型模式
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.1.3" data-path="../../engineering/design_pattern/singleton.html">
            
                <a href="../../engineering/design_pattern/singleton.html">
            
                    
                    1.3 单例模式
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.1.4" data-path="../../engineering/design_pattern/factory.html">
            
                <a href="../../engineering/design_pattern/factory.html">
            
                    
                    1.4 工厂模式
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.1.5" data-path="../../engineering/design_pattern/bridge.html">
            
                <a href="../../engineering/design_pattern/bridge.html">
            
                    
                    1.5 桥接模式
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.1.6" data-path="../../engineering/design_pattern/composite.html">
            
                <a href="../../engineering/design_pattern/composite.html">
            
                    
                    1.6 组合模式
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.1.7" data-path="../../engineering/design_pattern/facade.html">
            
                <a href="../../engineering/design_pattern/facade.html">
            
                    
                    1.7 门面模式
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.1.8" data-path="../../engineering/design_pattern/adapter.html">
            
                <a href="../../engineering/design_pattern/adapter.html">
            
                    
                    1.8 适配器模式
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.1.9" data-path="../../engineering/design_pattern/decorator.html">
            
                <a href="../../engineering/design_pattern/decorator.html">
            
                    
                    1.9 装饰者模式
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.1.10" data-path="../../engineering/design_pattern/flyweight.html">
            
                <a href="../../engineering/design_pattern/flyweight.html">
            
                    
                    1.10 享元模式
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.1.11" data-path="../../engineering/design_pattern/proxy.html">
            
                <a href="../../engineering/design_pattern/proxy.html">
            
                    
                    1.11 代理模式
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.1.12" data-path="../../engineering/design_pattern/middleware.html">
            
                <a href="../../engineering/design_pattern/middleware.html">
            
                    
                    1.12 中间件模式
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.3.2" data-path="../../engineering/network_prag/">
            
                <a href="../../engineering/network_prag/">
            
                    
                    2 网络编程
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.3.2.1" data-path="../../engineering/network_prag/socket.html">
            
                <a href="../../engineering/network_prag/socket.html">
            
                    
                    2.1 长连接
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.2.2" data-path="../../engineering/network_prag/mq.html">
            
                <a href="../../engineering/network_prag/mq.html">
            
                    
                    2.2 MQ
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.3.3" data-path="../">
            
                <a href="../">
            
                    
                    3 语言应用
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.3.3.1" data-path="node.html">
            
                <a href="node.html">
            
                    
                    3.1 Node.js
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter active" data-level="1.3.3.1.1" data-path="core.html">
            
                <a href="core.html">
            
                    
                    3.1.1 原理及构成
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.3.1.2" data-path="async.html">
            
                <a href="async.html">
            
                    
                    3.1.2 异步机制
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.3.1.3" data-path="important.html">
            
                <a href="important.html">
            
                    
                    3.1.3 一些核心概念
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.3.1.4" data-path="koa_web.html">
            
                <a href="koa_web.html">
            
                    
                    3.1.4 web应用: koa框架
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.3.1.5" data-path="koa.html">
            
                <a href="koa.html">
            
                    
                    3.1.5 koa源码分析
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.3.1.6" data-path="libuv.html">
            
                <a href="libuv.html">
            
                    
                    3.1.6 libuv网络库应用
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.3.1.7" data-path="apm.html">
            
                <a href="apm.html">
            
                    
                    3.1.7 性能调优
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.3.1.8" data-path="node_spider.html">
            
                <a href="node_spider.html">
            
                    
                    3.1.8 其他: Node爬虫
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.3.1.9" data-path="node_map_reduce.html">
            
                <a href="node_map_reduce.html">
            
                    
                    3.1.9 其他: Node编写Mapreduce
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.3.3.2" data-path="../c/c_and_plus.html">
            
                <a href="../c/c_and_plus.html">
            
                    
                    3.2 C/C++
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.3.3.2.1" data-path="../c/oop.html">
            
                <a href="../c/oop.html">
            
                    
                    3.2.1 面向对象
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.3.2.2" data-path="../c/ipcs.html">
            
                <a href="../c/ipcs.html">
            
                    
                    3.2.2 进程通信
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.3.2.3" data-path="../c/thread.html">
            
                <a href="../c/thread.html">
            
                    
                    3.2.3 线程管理
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.3.2.4" data-path="../c/memory.html">
            
                <a href="../c/memory.html">
            
                    
                    3.2.4 内存管理
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.3.2.5" data-path="../c/network.html">
            
                <a href="../c/network.html">
            
                    
                    3.2.5 网络编程
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.3.2.6" data-path="../c/build_tool.html">
            
                <a href="../c/build_tool.html">
            
                    
                    3.2.6 构建工具
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.3.2.7" data-path="../c/thread_pool.html">
            
                <a href="../c/thread_pool.html">
            
                    
                    3.2.7 其他: 线程池
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    

            </ul>
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.4" data-path="../../engineering/ci_deplopment/">
            
                <a href="../../engineering/ci_deplopment/">
            
                    
                    三 搭建部署
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.4.1" data-path="../../engineering/ci_deplopment/test.html">
            
                <a href="../../engineering/ci_deplopment/test.html">
            
                    
                    3.1 测试
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.4.1.1" data-path="../../engineering/ci_deplopment/test/unit_testing.html">
            
                <a href="../../engineering/ci_deplopment/test/unit_testing.html">
            
                    
                    3.1.1 单元测试
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.1.2" data-path="../../engineering/ci_deplopment/test/stress_testing.html">
            
                <a href="../../engineering/ci_deplopment/test/stress_testing.html">
            
                    
                    3.1.2 压力测试
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.4.2" data-path="../../engineering/ci_deplopment/ci_readme.html">
            
                <a href="../../engineering/ci_deplopment/ci_readme.html">
            
                    
                    3.2 集成
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.4.2.1" data-path="../../engineering/ci_deplopment/ci/gitlab_ci.html">
            
                <a href="../../engineering/ci_deplopment/ci/gitlab_ci.html">
            
                    
                    3.2.1 GitLab CI
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.2.2" data-path="../../engineering/ci_deplopment/ci/spinnaker.html">
            
                <a href="../../engineering/ci_deplopment/ci/spinnaker.html">
            
                    
                    3.2.2 Spinnaker
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.4.3" data-path="../../engineering/ci_deplopment/build.html">
            
                <a href="../../engineering/ci_deplopment/build.html">
            
                    
                    3.3 部署
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.4.3.1" data-path="../../engineering/ci_deplopment/k8s/k8s.html">
            
                <a href="../../engineering/ci_deplopment/k8s/k8s.html">
            
                    
                    3.3.1 k8s
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.3.2" data-path="../../engineering/ci_deplopment/rancher/rancher.html">
            
                <a href="../../engineering/ci_deplopment/rancher/rancher.html">
            
                    
                    3.3.2 rancher
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.3.3" data-path="../../engineering/ci_deplopment/swarm/swarm.html">
            
                <a href="../../engineering/ci_deplopment/swarm/swarm.html">
            
                    
                    3.3.3 swarm
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.4.4" data-path="../../engineering/ci_deplopment/maintenance.html">
            
                <a href="../../engineering/ci_deplopment/maintenance.html">
            
                    
                    3.4 监控
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.4.4.1" data-path="../../engineering/ci_deplopment/monitor.html">
            
                <a href="../../engineering/ci_deplopment/monitor.html">
            
                    
                    3.4.1 容器监控
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.4.2" data-path="../../engineering/ci_deplopment/trace.html">
            
                <a href="../../engineering/ci_deplopment/trace.html">
            
                    
                    3.4.2 系统监控
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.4.3" data-path="../../engineering/ci_deplopment/app1.md">
            
                <span>
            
                    
                    3.4.2 应用监控
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.4.5" data-path="../../engineering/ha/ha.html">
            
                <a href="../../engineering/ha/ha.html">
            
                    
                    3.5 高可用
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.4.5.1" data-path="../../engineering/ha/client.html">
            
                <a href="../../engineering/ha/client.html">
            
                    
                    3.5.1 接入层高可用
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.5.2" data-path="../../engineering/ha/service.html">
            
                <a href="../../engineering/ha/service.html">
            
                    
                    3.5.2 服务层高可用
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.5.3" data-path="../../engineering/ha/share.html">
            
                <a href="../../engineering/ha/share.html">
            
                    
                    3.5.3 存储层高可用
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.4.6" data-path="../../engineering/ci_deplopment/hc/hc.html">
            
                <a href="../../engineering/ci_deplopment/hc/hc.html">
            
                    
                    3.6 高并发
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.4.6.1" data-path="../../engineering/ci_deplopment/hc/dns.html">
            
                <a href="../../engineering/ci_deplopment/hc/dns.html">
            
                    
                    3.6.1 基于DNS的负载均衡
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.6.2" data-path="../../engineering/ci_deplopment/hc/lvs.html">
            
                <a href="../../engineering/ci_deplopment/hc/lvs.html">
            
                    
                    3.6.2 基于Lvs的负载均衡
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.6.3" data-path="../../engineering/ci_deplopment/hc/haproxy.html">
            
                <a href="../../engineering/ci_deplopment/hc/haproxy.html">
            
                    
                    3.6.3 基于haproxy的负载均衡
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.5" >
            
                <span>
            
                    
                    四 架构模式
            
                </span>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.5.1" >
            
                <span>
            
                    
                    1 微服务架构设计与实践
            
                </span>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.5.1.1" data-path="../java/spring-cloud.html">
            
                <a href="../java/spring-cloud.html">
            
                    
                    1.1 微服务概况
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.1.2" data-path="../java/spring-eureka.html">
            
                <a href="../java/spring-eureka.html">
            
                    
                    1.2 服务注册及发现
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.1.3" data-path="../java/spring-feign.html">
            
                <a href="../java/spring-feign.html">
            
                    
                    1.3 服务调用
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.1.4" data-path="../java/spring-zuul.html">
            
                <a href="../java/spring-zuul.html">
            
                    
                    1.4 网关及负载均衡
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.1.5" data-path="../java/spring-hystrix.html">
            
                <a href="../java/spring-hystrix.html">
            
                    
                    1.5 熔断、限流、扩缩容
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.1.6" data-path="../java/spring-config.html">
            
                <a href="../java/spring-config.html">
            
                    
                    1.6 云配置中心
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.1.7" data-path="../java/zipkin-tracing.html">
            
                <a href="../java/zipkin-tracing.html">
            
                    
                    1.7 分布式链路追踪
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.1.8" data-path="../java/swagger.html">
            
                <a href="../java/swagger.html">
            
                    
                    1.8 接口文档管理
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.5.2" data-path="../../domain/">
            
                <a href="../../domain/">
            
                    
                    2 领域驱动模型
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.5.2.1" data-path="../../domain/domain.html">
            
                <a href="../../domain/domain.html">
            
                    
                    2.1 领域--Domain
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.2.2" data-path="../../domain/entity.md">
            
                <span>
            
                    
                    2.2 领域实体--Entity
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.2.3" data-path="../../domain/object.html">
            
                <a href="../../domain/object.html">
            
                    
                    2.3 值对象--Value Object
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.2.4" data-path="../../domain/aggregate.html">
            
                <a href="../../domain/aggregate.html">
            
                    
                    2.4 聚合--Aggregate
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.2.5" data-path="../../domain/service.html">
            
                <a href="../../domain/service.html">
            
                    
                    2.5 服务--Services
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.2.6" data-path="../../domain/event.html">
            
                <a href="../../domain/event.html">
            
                    
                    2.6 领域事件--Event
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.2.7" data-path="../../domain/framework.html">
            
                <a href="../../domain/framework.html">
            
                    
                    2.7 几种常见的DDD架构
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.5.3" >
            
                <span>
            
                    
                    3 架构技术的演化与趋势
            
                </span>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.5.3.1" >
            
                <span>
            
                    
                    3.1 架构技术的发展历史及现状
            
                </span>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.3.2" >
            
                <span>
            
                    
                    3.2 Serverless无服务架构概念
            
                </span>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.3.3" >
            
                <span>
            
                    
                    3.3 ServerMesh网格服务概念
            
                </span>
            

            
        </li>
    

            </ul>
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.6" >
            
                <span>
            
                    
                    五 其他
            
                </span>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.6.1" data-path="../../story/talk.html">
            
                <a href="../../story/talk.html">
            
                    
                    5.1 小伙子,放松!
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    

    

    <li class="divider"></li>

    <li>
        <a href="https://www.gitbook.com" target="blank" class="gitbook-link">
            本书使用 GitBook 发布
        </a>
    </li>
</ul>


                </nav>
            
        
    </div>

    <div class="book-body">
        
            <div class="body-inner">
                
                    

<div class="book-header" role="navigation">
    

    <!-- Title -->
    <h1>
        <i class="fa fa-circle-o-notch fa-spin"></i>
        <a href="../.." >3.1.1 原理及构成</a>
    </h1>
</div>




                    <div class="page-wrapper" tabindex="-1" role="main">
                        <div class="page-inner">
                            
<div id="book-search-results">
    <div class="search-noresults">
    
                                <section class="normal markdown-section">
                                
                                <h3 id="&#x4E00;&#x3001;&#x7B80;&#x4ECB;">&#x4E00;&#x3001;&#x7B80;&#x4ECB;</h3>
<p>&#xA0;&#xA0;&#xA0;&#xA0;2009&#x5E74;&#xFF0C;Ryan Dahl&#x6B63;&#x5F0F;&#x63A8;&#x51FA;&#x57FA;&#x4E8E;JavaScript&#x8BED;&#x8A00;&#x548C;V8&#x5F15;&#x64CE;&#x7684;&#x5F00;&#x6E90;Web&#x670D;&#x52A1;&#x5668;&#x9879;&#x76EE;, &#x5176;&#x6700;&#x5927;&#x4F18;&#x52BF;&#x662F;&#x57FA;&#x4E8E;&#x4E8B;&#x4EF6;&#x9A71;&#x52A8;&#x53CA;V8&#x7684;&#x9AD8;&#x6027;&#x80FD;&#xFF0C;&#x5728;&#x6B64;&#x4E4B;&#x524D;Ryan Dahl&#x66FE;&#x662F;&#x4E00;&#x4F4D;&#x6570;&#x5B66;&#x7CFB;&#x5B66;&#x751F;&#xFF0C;&#x5176;&#x5728;&#x5357;&#x7F8E;&#x548C;&#x5973;&#x53CB;&#x65C5;&#x884C;&#x671F;&#x95F4;&#x4E3A;&#x8D5A;&#x53D6;&#x5916;&#x5FEB;&#xFF0C;&#x6210;&#x4E3A;&#x4E00;&#x540D;web&#x517C;&#x804C;&#x5F00;&#x53D1;&#x8005;&#xFF0C;&#x56E0;&#x5176;&#x5BF9;Nginx&#x9AD8;&#x6548;IO&#x6A21;&#x578B;&#x7684;&#x601D;&#x8003;&#x4E0E;V8&#x7684;&#x95EE;&#x4E16;&#x7B49;&#x4E00;&#x7CFB;&#x5217;&#x4E8B;&#x4EF6;&#xFF0C;&#x5F15;&#x53D1;&#x4E86;&#x5F00;&#x53D1;Node&#x7684;&#x60F3;&#x6CD5;&#xFF0C;&#x6700;&#x521D;Node&#x7684;&#x613F;&#x666F;&#x662F;&#x6784;&#x5EFA;&#x4E00;&#x4E2A;&#x5C0F;&#x5DE7;&#x5F3A;&#x5927;&#x7684;&#x5185;&#x6838;&#x5C42;&#x9762;&#x7684;API&#xFF0C;&#x5E76;&#x5728;&#x8FD9;&#x4E2A;&#x57FA;&#x7840;&#x4E0A;&#x53D1;&#x5C55;&#x51FA;&#x5404;&#x79CD;&#x6A21;&#x5757;&#x3002;</p>
<p>&#xA0;&#xA0;&#xA0;&#xA0;&#x4F46;&#x968F;&#x7740;&#x793E;&#x533A;&#x7684;&#x4E0D;&#x65AD;&#x58EE;&#x5927;&#xFF0C;Node&#x7684;&#x53D1;&#x5C55;&#x901F;&#x5EA6;&#x60CA;&#x4EBA;&#xFF0C;&#x77ED;&#x77ED;&#x56DB;&#x5E74;&#x5DF2;&#x7ECF;&#x88AB;&#x4E0A;&#x767E;&#x4E07;&#x5F00;&#x53D1;&#x8005;&#x63A5;&#x53D7;&#x3001;&#x4F7F;&#x7528;&#x3001;&#x7EF4;&#x62A4;&#xFF0C;Node&#x4E5F;&#x7531;&#x6700;&#x521D;&#x7684;&#x4E00;&#x4E2A;Demo&#x9879;&#x76EE;&#x6F14;&#x53D8;&#x4E3A;&#x4E00;&#x4E2A;&#x53EF;&#x4EE5;&#x8FDB;&#x884C;Http&#x3001;Tcp&#x3001;Utp&#x7B49;&#x901A;&#x4FE1;&#x7684;&#x529F;&#x80FD;&#x9F50;&#x5168;&#x7684;&#x5E9E;&#x5927;API&#x6846;&#x67B6;&#x3002;&#x800C;Rayan&#x672C;&#x4EBA;&#x5BF9;&#x4E8E;Node&#x7684;&#x53D1;&#x5C55;&#x4E5F;&#x5F88;&#x60CA;&#x8BB6;&#xFF0C;&#x66FE;&#x7ECF;&#x5728;&#x63A5;&#x53D7;&#x91C7;&#x8BBF;&#x65F6;&#x8868;&#x793A;&#x81EA;&#x5DF1;&#x4E3A;Node&#x611F;&#x5230;&#x9A84;&#x50B2;&#xFF0C;&#x7136;&#x800C;&#x968F;&#x540E;&#x5374;&#x6210;&#x4E3A;&#x8C37;&#x6B4C;&#x5927;&#x8111;&#x65D7;&#x4E0B;&#x7684;&#x4E00;&#x540D;&#x673A;&#x5668;&#x5B66;&#x4E60;&#x7814;&#x7A76;&#x5F00;&#x53D1;&#x8005;&#xFF0C;&#x4ED6;&#x4E5F;&#x8BB8;&#x5E76;&#x4E0D;&#x60F3;&#x6210;&#x4E3A;&#x4E00;&#x540D;Js&#x4E13;&#x5BB6;&#xFF0C;&#x4E5F;&#x4E0D;&#x60F3;&#x6210;&#x4E3A;&#x4E00;&#x540D;&#x673A;&#x5668;&#x5B66;&#x4E60;&#x4E13;&#x5BB6;&#xFF0C;&#x4F46;&#x5728;&#x6BCF;&#x4E2A;&#x63A5;&#x89E6;&#x5230;&#x7684;&#x9886;&#x57DF;&#x90FD;&#x505A;&#x81EA;&#x5DF1;&#x6240;&#x64C5;&#x957F;&#x5E76;&#x559C;&#x6B22;&#x7684;&#x4E8B;&#x3002;</p>
<hr>
<h3 id="&#x4E8C;&#x3001;&#x4E00;&#x4E9B;&#x6E90;&#x7801;&#x89E3;&#x6790;">&#x4E8C;&#x3001;&#x4E00;&#x4E9B;&#x6E90;&#x7801;&#x89E3;&#x6790;</h3>
<p>&#xA0;&#xA0;&#xA0;&#xA0;&#x4E86;&#x89E3;Node&#x6E90;&#x7801;&#xFF0C;&#x4E0D;&#x4F46;&#x53EF;&#x4EE5;&#x7406;&#x89E3;Node&#x7684;&#x5185;&#x90E8;&#x673A;&#x5236;&#xFF0C;&#x6784;&#x5EFA;&#x9AD8;&#x6027;&#x80FD;&#x7684;Node&#x670D;&#x52A1;&#xFF0C;&#x5E76;&#x6709;&#x9488;&#x5BF9;&#x6027;&#x7684;&#x8FDB;&#x884C;&#x4F18;&#x5316;&#x3001;&#x5FEB;&#x901F;&#x5B9A;&#x4F4D;&#x95EE;&#x9898;&#x3001;&#x67E5;&#x627E;&#x7CFB;&#x7EDF;&#x74F6;&#x9888;&#xFF0C;&#x8FD8;&#x53EF;&#x4EE5;&#x901A;&#x8FC7;Node&#x5168;&#x8C8C;&#x548C;&#x4E00;&#x4E9B;&#x6838;&#x5FC3;&#x6982;&#x5FF5;&#x6765;&#x5B66;&#x4E60;&#x5F00;&#x6E90;&#x9879;&#x76EE;&#x7684;&#x7EC4;&#x7EC7;&#x6A21;&#x5F0F;&#x3001;&#x5982;&#x4F55;&#x8FDB;&#x884C;&#x6A21;&#x5757;&#x5212;&#x5206;&#x7B49;&#x3002;</p>
<h4 id="21-node&#x6E90;&#x7801;&#x76EE;&#x5F55;&#x7ED3;&#x6784;">2.1 Node&#x6E90;&#x7801;&#x76EE;&#x5F55;&#x7ED3;&#x6784;</h4>
<pre><code class="lang-text">|____benchmark            # &#x57FA;&#x51C6;&#x6D4B;&#x8BD5;&#xFF0C;&#x7CFB;&#x7EDF;&#x6027;&#x80FD;&#x6D4B;&#x8BD5;&#x7B49;, &#x8BE5;&#x76EE;&#x5F55;&#x4E0B;&#x7684;&#x7A0B;&#x5E8F;&#x53EF;&#x5355;&#x72EC;&#x6D4B;&#x8BD5;&#x8FD0;&#x884C;
| |____arrays             # &#x6D4B;&#x8BD5;&#x6570;&#x7EC4;
| |____assert             # &#x6D4B;&#x8BD5;&#x65AD;&#x8A00;
| |____async_hooks        # &#x6D4B;&#x8BD5;&#x51FD;&#x6570;&#x52AB;&#x6301;&#x7B49;
| |____buffers            # &#x6D4B;&#x8BD5;buffer&#x8BFB;&#x5199;&#x3001;&#x7F16;&#x7801;&#x3001;&#x89E3;&#x7801;&#x7B49;&#x64CD;&#x4F5C;
| |____child_process      # &#x6D4B;&#x8BD5;&#x5B50;&#x8FDB;&#x7A0B;&#x521B;&#x5EFA;&#x3001;&#x901A;&#x4FE1;&#x7B49;
| |____cluster            # &#x6D4B;&#x8BD5;&#x96C6;&#x7FA4;&#x65B9;&#x6848;master work&#x7B49;
| |____crypto             # &#x6D4B;&#x8BD5;&#x52A0;&#x89E3;&#x5BC6;&#x5E93;&#x7B49;&#x64CD;&#x4F5C;
| |____dgram              # &#x6D4B;&#x8BD5;socket&#x901A;&#x4FE1;, &#x6570;&#x636E;&#x62A5;&#x4E2D;udp&#x76D1;&#x542C;&#x3001;&#x7ED1;&#x5B9A;&#x7B49;
| |____dns                # &#x6D4B;&#x8BD5;dns&#x57DF;&#x540D;&#x89E3;&#x6790;
| |____domain             # &#x5DF2;&#x5E9F;&#x5F03;
| |____es                 # &#x6821;&#x9A8C;&#x6570;&#x636E;&#x7C7B;&#x578B;&#x3001;&#x4E66;&#x5199;&#x98CE;&#x683C;
| |____events             # &#x6D4B;&#x8BD5;&#x4E8B;&#x4EF6;&#x6CE8;&#x518C;&#x3001;&#x76D1;&#x542C;&#x7B49;
| |____fixtures           # &#x6D4B;&#x8BD5;http/domain 
| |____fs                 # &#x6D4B;&#x8BD5;&#x6587;&#x4EF6;&#x5BF9;&#x8BFB;&#x5199;
| |____http               # &#x6D4B;&#x8BD5;http
| |____http2              # &#x6D4B;&#x8BD5;http2/&#x670D;&#x52A1;&#x7AEF;&#x63A8;&#x9001;&#x3001;&#x4E8C;&#x8FDB;&#x5236;&#x3001;&#x591A;&#x8DEF;&#x590D;&#x7528;&#x7B49;
| |____misc               # &#x6D4B;&#x8BD5;&#x6DF7;&#x6742;&#x9879;&#xFF0C;&#x5982;&#x53C2;&#x6570;&#x683C;&#x5F0F;&#x5316;&#x3001;&#x56DE;&#x8C03;
| |____module             # &#x6D4B;&#x8BD5;&#x6A21;&#x5757;&#x52A0;&#x8F7D;
| |____net                # &#x6D4B;&#x8BD5;net&#x6A21;&#x5757;&#x3001;&#x7F16;&#x7801;&#x3001;&#x89E3;&#x7801;&#x3001;&#x8BFB;&#x5199;&#x6D41;&#x7B49;
| |____os                 # &#x6D4B;&#x8BD5;&#x672C;&#x5730;&#x7CFB;&#x7EDF;&#x63A5;&#x53E3;
| |____path               # &#x6D4B;&#x8BD5;&#x8DE8;&#x5E73;&#x53F0;&#x4E0B;&#x8DEF;&#x5F84;&#x64CD;&#x4F5C;&#x76F8;&#x5173;&#x529F;&#x80FD;
| |____process            # &#x6D4B;&#x8BD5;&#x8FDB;&#x7A0B;&#x73AF;&#x5883;&#x53D8;&#x91CF;&#x3001;&#x5185;&#x5B58;&#x3001;&#x56DE;&#x8C03;&#x6267;&#x884C;&#x7B49;
| |____querystring        # &#x6D4B;&#x8BD5;&#x53C2;&#x6570;&#x89E3;&#x6790;
| |____streams            # &#x6D4B;&#x8BD5;&#x6D41;&#x76F8;&#x5173;
| |____string_decoder     # &#x6D4B;&#x8BD5;&#x5B57;&#x7B26;&#x4E32;&apos;ascii&apos;, &apos;utf8&apos;, &apos;utf-8&apos;, &apos;base64&apos;&#x7B49;&#x64CD;&#x4F5C;  
| |____timers             # &#x6D4B;&#x8BD5;&#x5B9A;&#x65F6;&#x5668;&#x76F8;&#x5173;
| |____tls                # &#x6D4B;&#x8BD5;&#x5B89;&#x5168;&#x8FDE;&#x63A5;&#xFF0C;&#x5982;&#x63E1;&#x624B;&#x3001;&#x8BC1;&#x4E66;
| |____url                # &#x6D4B;&#x8BD5;url&#x89E3;&#x6790;
| |____util               # &#x6D4B;&#x8BD5;&#x5DE5;&#x5177;&#x5E93;
| |____v8                 # &#x6D4B;&#x8BD5;v8&#x5185;&#x5B58;&#x5806;&#x6808;&#x4F7F;&#x7528;&#x60C5;&#x51B5;
| |____vm                 # &#x6D4B;&#x8BD5;vm&#x865A;&#x62DF;&#x673A;&#x3001;&#x4E0A;&#x4E0B;&#x6587;&#x7B49;
| |____worker             # &#x6D4B;&#x8BD5;&#x5E7F;&#x64AD;&#x901A;&#x4FE1;&#x7B49;
| |____zlib               # &#x6D4B;&#x8BD5;&#x538B;&#x7F29;
| |____*.*                # &#x5176;&#x4ED6;&#x6587;&#x4EF6;&#x5305;&#x62EC;&#x4EE3;&#x7801;&#x5BA1;&#x67E5;&#x7B49;
|____deps                 # &#x4F9D;&#x8D56;&#x7684;&#x8DE8;&#x5E73;&#x53F0;&#x6838;&#x5FC3;&#x5E93;&#xFF0C;&#x5982;v8&#x3001;libuv&#x3001;npm&#x3001;http&#x3001;openssl&#x9759;&#x6001;&#x94FE;&#x63A5;&#x5E93;
| |____acorn              # JS&#x6E90;&#x7801;&#x89E3;&#x6790;&#x5E93;&#x8F85;&#x52A9;v8&#x7F16;&#x8BD1;&#xFF0C;&#x5982;&#x8BCD;&#x6CD5;&#x3001;&#x8BED;&#x6CD5;&#x5206;&#x6790;
| |____cares              # &#x6838;&#x5FC3;&#x5E93;&#x7684;C/C++&#x4F9D;&#x8D56;&#xFF0C;&#x5982;socket&#x3001;&#x5B9A;&#x65F6;&#x5668;
| |____gtest              # C++&#x5355;&#x5143;&#x6D4B;&#x8BD5;&#x6846;&#x67B6;,&#x5305;&#x62EC;&#x65AD;&#x8A00;&#x3001;&#x81F4;&#x547D;&#x3001;&#x975E;&#x81F4;&#x547D;&#x3001;&#x6B7B;&#x4EA1;&#x6D4B;&#x8BD5;&#x7B49;
| |____http-parser        # http&#x76F8;&#x5173;&#xFF0C;&#x5982;&#x8BF7;&#x6C42;&#x53C2;&#x6570;&#x89E3;&#x6790;
| |____icu-small          # &#x56FD;&#x9645;&#x5316;&#x7EC4;&#x4EF6;&#x7B49;
| |____nghttp2            # http2&#x7684;C&#x5B9E;&#x73B0;
| |____node-inpect        # node&#x8C03;&#x8BD5;&#x5DE5;&#x5177;
| |____npm                # node&#x5305;&#x7BA1;&#x7406;
| |____openssl            # &#x5B89;&#x5168;&#x5957;&#x63A5;&#x5B57;&#x5C42;&#x5BC6;&#x7801;&#x5E93;
| |____uv                 # node&#x8DE8;&#x5E73;&#x53F0;IO&#x5E93;&#x64CD;&#x4F5C;&#x7B49;
| |____v8                 # node&#x8FD0;&#x884C;&#x73AF;&#x5883;
| |____zlib               # &#x89E3;&#x538B;&#x7F29;
|____doc                  # &#x6587;&#x6863;
| |____api                # node&#x539F;&#x751F;&#x6A21;&#x5757;&#x6587;&#x6863;
| |____api_assets         # &#x6587;&#x6863;&#x914D;&#x7F6E;&#x751F;&#x6210;&#x76F8;&#x5173;
| |____changelogs         # node&#x5386;&#x53F2;&#x7248;&#x672C;&#x4FEE;&#x6539;&#x8BB0;&#x5F55;
| |____guides             # &#x65B0;&#x624B;&#x5F15;&#x5BFC;
| |____*.*                # &#x53D1;&#x884C;&#x7248;&#x4FE1;&#x606F;&#x7B49;
|____lib                  # &#x539F;&#x751F;&#x6A21;&#x5757;&#x7684;js&#x8C03;&#x7528;&#x5E93;
| |____internal           # &#x5185;&#x7F6E;&#x6A21;&#x5757;&#xFF0C;&#x5982;require&#x3001;process&#x3001;load&#x7B49;&#x5B9E;&#x73B0;
| |____*.js               # &#x539F;&#x751F;&#x6A21;&#x5757;&#x5982;buffer&#x3001;&#x8FDB;&#x7A0B;&#x3001;&#x5DE5;&#x5177;&#x5E93;&#x7B49;
|____src                  # node&#x6E90;&#x7801;
| |____inspector          # &#x8C03;&#x8BD5;&#x76F8;&#x5173;
| |____res                # man&#x5E2E;&#x52A9;&#x76F8;&#x5173;
| |____tracing            # &#x5806;&#x6808;&#x8FFD;&#x8E2A;
| |____*.*                # &#x7F16;&#x8BD1;js&#x3001;&#x5168;&#x5C40;&#x53D8;&#x91CF;&#x3001;&#x6A21;&#x5757;&#x52A0;&#x8F7D;&#x7B49;&#xFF0C;&#x7A0B;&#x5E8F;&#x5165;&#x53E3;&#x6587;&#x4EF6;&#x4E3A;node_main.cc
|____test                 # &#x5355;&#x5143;&#x6D4B;&#x8BD5;
| |____*.*                # &#x5404;&#x4E2A;&#x6A21;&#x5757;&#x7684;&#x6D4B;&#x8BD5;&#x7528;&#x4F8B;
|____tools                # python&#x5DE5;&#x5177;&#x5E93;
| |____*.*                # &#x4E3B;&#x8981;&#x662F;python&#x94FE;&#x63A5;JS&#x3001;C/C++&#x76F8;&#x5173;&#x7684;&#x7F16;&#x8BD1;&#x3001;&#x7EC4;&#x4EF6;&#x3001;&#x9879;&#x76EE;&#x6784;&#x5EFA;gyp&#x7B49;
|____Makefile             # C/C++&#x7F16;&#x8BD1;&#x5DE5;&#x5177;&#x6587;&#x4EF6;
|____configure            # C/C++&#x7F16;&#x8BD1;&#x5DE5;&#x5177;&#x6587;&#x4EF6;
|____README.md            # &#x9879;&#x76EE;&#x6587;&#x4EF6;
|____node.gyp             # &#x9879;&#x76EE;&#x6784;&#x5EFA;gyp&#x914D;&#x7F6E;
|____*.*                  # &#x5176;&#x4ED6;
</code></pre>
<hr>
<h4 id="22-&#x6838;&#x5FC3;&#x6982;&#x5FF5;">2.2 &#x6838;&#x5FC3;&#x6982;&#x5FF5;</h4>
<ul>
<li>2.2.1 libuv</li>
</ul>
<p>&#xA0;&#xA0;&#xA0;&#xA0;libuv&#x662F;&#x4E13;&#x4E3A;node&#x800C;&#x751F;&#x7684;&#x8DE8;&#x5E73;&#x53F0;&#x5F02;&#x6B65;IO&#x5E93;&#xFF0C;&#x5176;&#x4E3B;&#x8981;&#x5B9E;&#x73B0;&#x7F51;&#x8DEF;&#x7F16;&#x7A0B;&#x3001;&#x4E8B;&#x4EF6;&#x5FAA;&#x73AF;&#x3001;&#x7EBF;&#x7A0B;&#x53CA;&#x7EBF;&#x7A0B;&#x6C60;&#x3001;dns&#x67E5;&#x8BE2;&#x7B49;&#x529F;&#x80FD;&#xFF0C;&#x5982;&#x4E0B;&#x56FE;:</p>
<p><img src="http://cdn.find-world.top/libuv_1.png" alt="&#x6253;&#x5370;"></p>
<ul>
<li>epoll: linux&#x4E0B;&#x7F51;&#x7EDC;IO&#x5F02;&#x6B65;&#x5E76;&#x53D1;</li>
<li>kqueue: freeBSD&#x4E0B;&#x7F51;&#x7EDC;IO&#x5F02;&#x6B65;&#x5E76;&#x53D1;</li>
<li>IOPC: Win&#x4E0B;&#x7F51;&#x7EDC;IO&#x5E76;&#x53D1;</li>
<li><p>threads: &#x7EBF;&#x7A0B;&#x6C60;&#xFF0C;&#x7528;&#x4E8E;&#x6587;&#x4EF6;IO&#x5E76;&#x53D1;&#x64CD;&#x4F5C;&#x7B49;</p>
</li>
<li><p>2.2.2 v8</p>
</li>
</ul>
<p>&#xA0;&#xA0;&#xA0;&#xA0;v8&#x662F;node&#x7684;&#x8FD0;&#x884C;&#x73AF;&#x5883;&#xFF0C;&#x7531;Lars Bak&#x9886;&#x5BFC;&#x5F00;&#x53D1;&#xFF0C;&#x6B64;&#x4EBA;&#x4E5F;&#x53C2;&#x4E0E;&#x5F00;&#x53D1;&#x8FC7;HotSpot&#xFF0C;&#x53EF;&#x4EE5;&#x60F3;&#x8C61;&#x4E0E;jvm&#x4F1A;&#x6709;&#x5F88;&#x591A;&#x76F8;&#x540C;&#x7684;&#x8BBE;&#x8BA1;&#x7406;&#x5FF5;&#xFF0C;v8&#x540C;&#x6837;&#x91C7;&#x7528;jit&#x7F16;&#x8BD1;&#x6280;&#x672F;&#xFF0C;&#x7531;&#x4E8E;&#x5176;&#x9AD8;&#x6548;&#x7684;gc&#x6280;&#x672F;&#x3001;&#x5185;&#x5D4C;&#x7F13;&#x5B58;&#x3001;&#x9690;&#x85CF;&#x7C7B;&#xFF0C;&#x6267;&#x884C;js&#x4EE3;&#x7801;&#x76F8;&#x5BF9;&#x4E4B;&#x524D;&#x7684;&#x5F15;&#x64CE;&#x90FD;&#x66F4;&#x5FEB;&#x3002;v8&#x4E2D;&#x4E00;&#x4E9B;&#x91CD;&#x8981;&#x6982;&#x5FF5;&#x5982;&#x4E0B;&#xFF0C;&#x8BE6;&#x89E3;&#x53EF;&#x53C2;&#x8003;<a href="https://v8docs.nodesource.com/" target="_blank">v8&#x6587;&#x6863;</a></p>
<pre><code class="lang-js">- v8::Context;          <span class="hljs-comment">// &#x5F15;&#x64CE;&#x4E0A;&#x4E0B;&#x6587;</span>
- v8::FunctionTemplate; <span class="hljs-comment">// &#x51FD;&#x6570;&#x6A21;&#x677F;</span>
- v8::HandleScope;      <span class="hljs-comment">// HandleScopeData&#x7684;&#x6570;&#x636E;&#x5907;&#x4EFD;</span>
- v8::Integer;          <span class="hljs-comment">// &#x89E3;&#x6790;js&#x6574;&#x578B;&#x6570;&#x636E;</span>
- v8::Isolate;          <span class="hljs-comment">// &#x5F15;&#x64CE;&#x5B9E;&#x4F8B;</span>
- v8::Local;            <span class="hljs-comment">// GC&#x7BA1;&#x7406;&#x7684;&#x5BF9;&#x8C61;&#x5F15;&#x7528;</span>
- v8::Message;          <span class="hljs-comment">// &#x6D88;&#x606F;&#x5904;&#x7406;&#x7C7B;</span>
- v8::<span class="hljs-built_in">Number</span>;           <span class="hljs-comment">// &#x89E3;&#x6790;js Number&#x6570;&#x636E;</span>
- v8::StackFrame;       <span class="hljs-comment">// &#x6808;&#x8D1E;</span>
- v8::StackTrace;       <span class="hljs-comment">// &#x6808;&#x8FFD;&#x8E2A;</span>
- v8::<span class="hljs-built_in">String</span>;           <span class="hljs-comment">// &#x89E3;&#x6790;js String&#x6570;&#x636E;</span>
- v8::Value;            <span class="hljs-comment">// &#x6240;&#x6709;&#x6570;&#x636E;&#x7C7B;&#x578B;&#x7684;&#x7236;&#x7C7B;</span>
</code></pre>
<h4 id="23-&#x4ECE;node-appjs&#x5206;&#x6790;&#x6267;&#x884C;&#x8FC7;&#x7A0B;">2.3 &#x4ECE;node app.js&#x5206;&#x6790;&#x6267;&#x884C;&#x8FC7;&#x7A0B;</h4>
<ul>
<li>2.3.1 node_main.cc, V8&#x4E3B;&#x51FD;&#x6570;</li>
</ul>
<pre><code class="lang-C++"><span class="hljs-function"><span class="hljs-keyword">int</span> <span class="hljs-title">main</span><span class="hljs-params">(<span class="hljs-keyword">int</span> argc, <span class="hljs-keyword">char</span>* argv[])</span> </span>{
<span class="hljs-meta">#<span class="hljs-meta-keyword">if</span> defined(__POSIX__) &amp;&amp; defined(NODE_SHARED_MODE)</span>
  <span class="hljs-comment">// In node::PlatformInit(), we squash all signal handlers for non-shared lib</span>
  <span class="hljs-comment">// build. In order to run test cases against shared lib build, we also need</span>
  <span class="hljs-comment">// to do the same thing for shared lib build here, but only for SIGPIPE for</span>
  <span class="hljs-comment">// now. If node::PlatformInit() is moved to here, then this section could be</span>
  <span class="hljs-comment">// removed.</span>
  {
    <span class="hljs-keyword">struct</span> sigaction act;
    <span class="hljs-built_in">memset</span>(&amp;act, <span class="hljs-number">0</span>, <span class="hljs-keyword">sizeof</span>(act));
    act.sa_handler = SIG_IGN;
    sigaction(SIGPIPE, &amp;act, <span class="hljs-literal">nullptr</span>);
  }
<span class="hljs-meta">#<span class="hljs-meta-keyword">endif</span></span>

<span class="hljs-meta">#<span class="hljs-meta-keyword">if</span> defined(__linux__)</span>
  <span class="hljs-keyword">char</span>** envp = environ;
  <span class="hljs-keyword">while</span> (*envp++ != <span class="hljs-literal">nullptr</span>) {}
  Elf_auxv_t* auxv = <span class="hljs-keyword">reinterpret_cast</span>&lt;Elf_auxv_t*&gt;(envp);
  <span class="hljs-keyword">for</span> (; auxv-&gt;a_type != AT_NULL; auxv++) {
    <span class="hljs-keyword">if</span> (auxv-&gt;a_type == AT_SECURE) {
      node::linux_at_secure = auxv-&gt;a_un.a_val;
      <span class="hljs-keyword">break</span>;
    }
  }
<span class="hljs-meta">#<span class="hljs-meta-keyword">endif</span></span>
  <span class="hljs-comment">// Disable stdio buffering, it interacts poorly with printf()</span>
  <span class="hljs-comment">// calls elsewhere in the program (e.g., any logging from V8.)</span>
  setvbuf(<span class="hljs-built_in">stdout</span>, <span class="hljs-literal">nullptr</span>, _IONBF, <span class="hljs-number">0</span>);
  setvbuf(<span class="hljs-built_in">stderr</span>, <span class="hljs-literal">nullptr</span>, _IONBF, <span class="hljs-number">0</span>);
  <span class="hljs-keyword">return</span> node::Start(argc, argv);
}
<span class="hljs-meta">#<span class="hljs-meta-keyword">endif</span></span>
</code></pre>
<ul>
<li>2.3.2 node.cc, &#x521D;&#x59CB;&#x5316;&#x5F15;&#x64CE;&#x5B9E;&#x4F8B;isolate&#xFF0C;&#x4E0A;&#x4E0B;&#x6587;&#xFF0C;&#x5E76;&#x52A0;&#x8F7D;&#x73AF;&#x5883;&#x53D8;&#x91CF;</li>
</ul>
<pre><code class="lang-C++"><span class="hljs-function"><span class="hljs-keyword">int</span> <span class="hljs-title">Start</span><span class="hljs-params">(<span class="hljs-keyword">int</span> argc, <span class="hljs-keyword">char</span>** argv)</span> </span>{
  atexit([] () { uv_tty_reset_mode(); });
  PlatformInit();
  performance::performance_node_start = PERFORMANCE_NOW();

  CHECK_GT(argc, <span class="hljs-number">0</span>);

  <span class="hljs-comment">// Hack around with the argv pointer. Used for process.title = &quot;blah&quot;.</span>
  argv = uv_setup_args(argc, argv);

  <span class="hljs-comment">// This needs to run *before* V8::Initialize().  The const_cast is not</span>
  <span class="hljs-comment">// optional, in case you&apos;re wondering.</span>
  <span class="hljs-keyword">int</span> exec_argc;
  <span class="hljs-keyword">const</span> <span class="hljs-keyword">char</span>** exec_argv;
  Init(&amp;argc, <span class="hljs-keyword">const_cast</span>&lt;<span class="hljs-keyword">const</span> <span class="hljs-keyword">char</span>**&gt;(argv), &amp;exec_argc, &amp;exec_argv);

<span class="hljs-meta">#<span class="hljs-meta-keyword">if</span> HAVE_OPENSSL</span>
  {
    <span class="hljs-built_in">std</span>::<span class="hljs-built_in">string</span> extra_ca_certs;
    <span class="hljs-keyword">if</span> (SafeGetenv(<span class="hljs-string">&quot;NODE_EXTRA_CA_CERTS&quot;</span>, &amp;extra_ca_certs))
      crypto::UseExtraCaCerts(extra_ca_certs);
  }
<span class="hljs-meta">#<span class="hljs-meta-keyword">ifdef</span> NODE_FIPS_MODE</span>
  <span class="hljs-comment">// In the case of FIPS builds we should make sure</span>
  <span class="hljs-comment">// the random source is properly initialized first.</span>
  OPENSSL_init();
<span class="hljs-meta">#<span class="hljs-meta-keyword">endif</span>  <span class="hljs-comment">// NODE_FIPS_MODE</span></span>
  <span class="hljs-comment">// V8 on Windows doesn&apos;t have a good source of entropy. Seed it from</span>
  <span class="hljs-comment">// OpenSSL&apos;s pool.</span>
  V8::SetEntropySource(crypto::EntropySource);
<span class="hljs-meta">#<span class="hljs-meta-keyword">endif</span>  <span class="hljs-comment">// HAVE_OPENSSL</span></span>

  v8_platform.Initialize(v8_thread_pool_size);
  V8::Initialize();
  performance::performance_v8_start = PERFORMANCE_NOW();
  v8_initialized = <span class="hljs-literal">true</span>;
  <span class="hljs-keyword">const</span> <span class="hljs-keyword">int</span> exit_code =
      Start(uv_default_loop(), argc, argv, exec_argc, exec_argv);
  v8_platform.StopTracingAgent();
  v8_initialized = <span class="hljs-literal">false</span>;
  V8::Dispose();

  <span class="hljs-comment">// uv_run cannot be called from the time before the beforeExit callback</span>
  <span class="hljs-comment">// runs until the program exits unless the event loop has any referenced</span>
  <span class="hljs-comment">// handles after beforeExit terminates. This prevents unrefed timers</span>
  <span class="hljs-comment">// that happen to terminate during shutdown from being run unsafely.</span>
  <span class="hljs-comment">// Since uv_run cannot be called, uv_async handles held by the platform</span>
  <span class="hljs-comment">// will never be fully cleaned up.</span>
  v8_platform.Dispose();

  <span class="hljs-keyword">delete</span>[] exec_argv;
  exec_argv = <span class="hljs-literal">nullptr</span>;

  <span class="hljs-keyword">return</span> exit_code;
}
</code></pre>
<p>&#x5185;&#x8054;&#x51FD;&#x6570;</p>
<pre><code class="lang-C++">inline int Start(Isolate* isolate, IsolateData* isolate_data,
                 int argc, const char* const* argv,
                 int exec_argc, const char* const* exec_argv) {
  HandleScope handle_scope(isolate);
  Local&lt;Context&gt; context = NewContext(isolate);
  Context::Scope context_scope(context);
  Environment env(isolate_data, context, v8_platform.GetTracingAgent());
  env.Start(argc, argv, exec_argc, exec_argv, v8_is_profiling);

  TRACE_EVENT_METADATA1(&quot;__metadata&quot;, &quot;version&quot;, &quot;node&quot;, NODE_VERSION_STRING);
  TRACE_EVENT_METADATA1(&quot;__metadata&quot;, &quot;thread_name&quot;, &quot;name&quot;,
                        &quot;JavaScriptMainThread&quot;);

  const char* path = argc &gt; 1 ? argv[1] : nullptr;
  StartInspector(&amp;env, path, debug_options);

  if (debug_options.inspector_enabled() &amp;&amp; !v8_platform.InspectorStarted(&amp;env))
    return 12;  // Signal internal error.

  env.set_abort_on_uncaught_exception(abort_on_uncaught_exception);

  if (no_force_async_hooks_checks) {
    env.async_hooks()-&gt;no_force_checks();
  }

  {
    Environment::AsyncCallbackScope callback_scope(&amp;env);
    env.async_hooks()-&gt;push_async_ids(1, 0);
    LoadEnvironment(&amp;env);
    env.async_hooks()-&gt;pop_async_id(1);
  }

  env.set_trace_sync_io(trace_sync_io);

  {
    SealHandleScope seal(isolate);
    bool more;
    env.performance_state()-&gt;Mark(
        node::performance::NODE_PERFORMANCE_MILESTONE_LOOP_START);
    do {
      uv_run(env.event_loop(), UV_RUN_DEFAULT);

      v8_platform.DrainVMTasks(isolate);

      more = uv_loop_alive(env.event_loop());
      if (more)
        continue;

      RunBeforeExit(&amp;env);

      // Emit `beforeExit` if the loop became alive either after emitting
      // event, or after running some callbacks.
      more = uv_loop_alive(env.event_loop());
    } while (more == true);
    env.performance_state()-&gt;Mark(
        node::performance::NODE_PERFORMANCE_MILESTONE_LOOP_EXIT);
  }

  env.set_trace_sync_io(false);

  const int exit_code = EmitExit(&amp;env);

  WaitForInspectorDisconnect(&amp;env);

  env.set_can_call_into_js(false);
  env.stop_sub_worker_contexts();
  uv_tty_reset_mode();
  env.RunCleanup();
  RunAtExit(&amp;env);

  v8_platform.DrainVMTasks(isolate);
  v8_platform.CancelVMTasks(isolate);
#if defined(LEAK_SANITIZER)
  __lsan_do_leak_check();
#endif

  return exit_code;
}
</code></pre>
<hr>
<ul>
<li>2.3.3 &#x7F16;&#x8BD1;&#x6E90;&#x7801;(source code)</li>
</ul>
<p>&#xA0;&#xA0;&#xA0;&#xA0;v8::Script::Compile(env-&gt;context(), source, &amp;origin)&#x4F1A;&#x6839;&#x636E;argv&#x5C06;&#x5F53;&#x524D;&#x7684;js&#x6587;&#x4EF6;&#x8FDB;&#x884C;&#x8BED;&#x6CD5;&#x8BCD;&#x6CD5;&#x5206;&#x6790;&#xFF0C;&#x5E76;&#x62BD;&#x8C61;&#x51FA;&#x8BED;&#x6CD5;&#x6811;&#xFF0C;&#x9884;&#x52A0;&#x8F7D;&#x5BF9;&#x5E94;&#x7684;node&#x6A21;&#x5757;&#x7B49;&#xFF0C;&#x8BCD;&#x6CD5;&#x5206;&#x6790;&#x5728;V8&#x6E90;&#x7801;src/parsing&#x76EE;&#x5F55;&#x4E0B;&#xFF0C;&#x5BF9;&#x5E94;&#x7684;C&#x6587;&#x4EF6;&#x6709;token.cc&#x3001;parsing.cc&#x7B49;&#x3002;</p>
<pre><code class="lang-C++">// Executes a str within the current v8 context.
static MaybeLocal&lt;Value&gt; ExecuteString(Environment* env,
                                       Local&lt;String&gt; source,
                                       Local&lt;String&gt; filename) {
  EscapableHandleScope scope(env-&gt;isolate());
  TryCatch try_catch(env-&gt;isolate());

  // try_catch must be nonverbose to disable FatalException() handler,
  // we will handle exceptions ourself.
  try_catch.SetVerbose(false);

  ScriptOrigin origin(filename);
  MaybeLocal&lt;v8::Script&gt; script =
      v8::Script::Compile(env-&gt;context(), source, &amp;origin);
  if (script.IsEmpty()) {
    ReportException(env, try_catch);
    env-&gt;Exit(3);
    return MaybeLocal&lt;Value&gt;();
  }

  MaybeLocal&lt;Value&gt; result = script.ToLocalChecked()-&gt;Run(env-&gt;context());
  if (result.IsEmpty()) {
    if (try_catch.HasTerminated()) {
      env-&gt;isolate()-&gt;CancelTerminateExecution();
      return MaybeLocal&lt;Value&gt;();
    }
    ReportException(env, try_catch);
    env-&gt;Exit(4);
    return MaybeLocal&lt;Value&gt;();
  }

  return scope.Escape(result.ToLocalChecked());
}
</code></pre>
<hr>
<h4 id="24-&#x603B;&#x7ED3;">2.4 &#x603B;&#x7ED3;</h4>
<p>&#xA0;&#xA0;&#xA0;&#xA0;&#x901A;&#x8FC7;node app.js&#x53EF;&#x4EE5;&#x4E86;&#x89E3;&#x5230;Node&#x7684;&#x672C;&#x8D28;&#x662F;&#x8FD0;&#x884C;&#x5728;V8&#x4E2D;&#x7684;&#x4E00;&#x6BB5;C++&#x7A0B;&#x5E8F;&#xFF0C;&#x53EA;&#x4E0D;&#x8FC7;&#x662F;&#x901A;&#x8FC7;js&#x7F16;&#x5199;&#x6E90;&#x7801;&#xFF0C;V8&#x63D0;&#x4F9B;&#x8FD0;&#x884C;&#x73AF;&#x5883;&#xFF0C;js&#x672C;&#x8EAB;&#x65E0;&#x6CD5;&#x8FDB;&#x884C;&#x6587;&#x4EF6;&#x64CD;&#x4F5C;&#x3001;tcp&#x3001;http&#x7B49;&#x7F51;&#x7EDC;&#x7F16;&#x7A0B;&#x3001;&#x7EBF;&#x7A0B;&#x5E76;&#x53D1;&#x7F16;&#x7A0B;&#x53CA;&#x7CFB;&#x7EDF;&#x8C03;&#x7528;&#xFF0C;&#x8FD9;&#x4E9B;&#x5219;&#x901A;&#x8FC7;&#x8C03;&#x7528;libuv&#x5BF9;&#x5E94;&#x7684;Api&#x5B9E;&#x73B0;&#x3002;</p>
<hr>
<h3 id="&#x53C2;&#x8003;">&#x53C2;&#x8003;</h3>
<ul>
<li><a href="https://nodejs.org/dist/latest-v8.x/docs/api/" target="_blank">1&#x3001;Node&#x5B98;&#x6587;&#x6587;&#x6863;</a></li>
<li><a href="https://v8docs.nodesource.com/" target="_blank">2&#x3001;v8&#x6587;&#x6863;</a></li>
<li><a href="https://github.com/libuv/libuv" target="_blank">3&#x3001;libuv&#x6587;&#x6863;</a></li>
<li><a href="https://developer.mozilla.org/zh-CN/docs/Web/JavaScript" target="_blank">4&#x3001;MDN</a></li>
</ul>
<footer class="page-footer"><span class="copyright">Copyright &#xA9; &#x4E00;&#x84D1;&#x70DF;&#x96E8;&#x4EFB;&#x5E73;&#x751F; all right reserved&#xFF0C;powered by Gitbook</span><span class="footer-modification">&#x4FEE;&#x6539;&#x65F6;&#x95F4;: 
2021-04-09 11:09:02
</span></footer>
                                
                                </section>
                            
    </div>
    <div class="search-results">
        <div class="has-results">
            
            <h1 class="search-results-title"><span class='search-results-count'></span> results matching "<span class='search-query'></span>"</h1>
            <ul class="search-results-list"></ul>
            
        </div>
        <div class="no-results">
            
            <h1 class="search-results-title">No results matching "<span class='search-query'></span>"</h1>
            
        </div>
    </div>
</div>

                        </div>
                    </div>
                
            </div>

            
                
                <a href="node.html" class="navigation navigation-prev " aria-label="Previous page: 3.1 Node.js">
                    <i class="fa fa-angle-left"></i>
                </a>
                
                
                <a href="async.html" class="navigation navigation-next " aria-label="Next page: 3.1.2 异步机制">
                    <i class="fa fa-angle-right"></i>
                </a>
                
            
        
    </div>

    <script>
        var gitbook = gitbook || [];
        gitbook.push(function() {
            gitbook.page.hasChanged({"page":{"title":"3.1.1 原理及构成","level":"1.3.3.1.1","depth":4,"next":{"title":"3.1.2 异步机制","level":"1.3.3.1.2","depth":4,"path":"program/nodejs/async.md","ref":"program/nodejs/async.md","articles":[]},"previous":{"title":"3.1 Node.js","level":"1.3.3.1","depth":3,"path":"program/nodejs/node.md","ref":"program/nodejs/node.md","articles":[{"title":"3.1.1 原理及构成","level":"1.3.3.1.1","depth":4,"path":"program/nodejs/core.md","ref":"program/nodejs/core.md","articles":[]},{"title":"3.1.2 异步机制","level":"1.3.3.1.2","depth":4,"path":"program/nodejs/async.md","ref":"program/nodejs/async.md","articles":[]},{"title":"3.1.3 一些核心概念","level":"1.3.3.1.3","depth":4,"path":"program/nodejs/important.md","ref":"program/nodejs/important.md","articles":[]},{"title":"3.1.4 web应用: koa框架","level":"1.3.3.1.4","depth":4,"path":"program/nodejs/koa_web.md","ref":"program/nodejs/koa_web.md","articles":[]},{"title":"3.1.5 koa源码分析","level":"1.3.3.1.5","depth":4,"path":"program/nodejs/koa.md","ref":"program/nodejs/koa.md","articles":[]},{"title":"3.1.6 libuv网络库应用","level":"1.3.3.1.6","depth":4,"path":"program/nodejs/libuv.md","ref":"program/nodejs/libuv.md","articles":[]},{"title":"3.1.7 性能调优","level":"1.3.3.1.7","depth":4,"path":"program/nodejs/apm.md","ref":"program/nodejs/apm.md","articles":[]},{"title":"3.1.8 其他: Node爬虫","level":"1.3.3.1.8","depth":4,"path":"program/nodejs/node_spider.md","ref":"program/nodejs/node_spider.md","articles":[]},{"title":"3.1.9 其他: Node编写Mapreduce","level":"1.3.3.1.9","depth":4,"path":"program/nodejs/node_map_reduce.md","ref":"program/nodejs/node_map_reduce.md","articles":[]}]},"dir":"ltr"},"config":{"plugins":["disqus","tree","splitter","local-video","chart","github-buttons","tbfed-pagefooter","ace","katex"],"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"pluginsConfig":{"tbfed-pagefooter":{"copyright":"Copyright &copy 一蓑烟雨任平生","modify_label":"修改时间: ","modify_format":"YYYY-MM-DD HH:mm:ss"},"disqus":{"useIdentifier":false,"shortName":"gitbookuse"},"ace":{},"splitter":{},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"katex":{},"fontsettings":{"theme":"white","family":"sans","size":2},"highlight":{},"github-buttons":{"repo":"TIME-GATE/","types":["star","watch"],"size":"large"},"local-video":{},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false},"tree":{},"chart":{"type":"c3"}},"theme":"default","author":"zq_sdk@163.com","name":"name","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"Ebook","language":"zh-hans","gitbook":"*","description":"电子书"},"file":{"path":"program/nodejs/core.md","mtime":"2021-04-09T03:09:02.255Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2021-04-10T12:23:44.633Z"},"basePath":"../..","book":{"language":""}});
        });
    </script>
</div>

        
    <script src="../../gitbook/gitbook.js"></script>
    <script src="../../gitbook/theme.js"></script>
    
        
        <script src="https://cdnjs.cloudflare.com/ajax/libs/URI.js/1.16.1/URI.min.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-disqus/plugin.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-tree/jquery.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-tree/plugin.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-splitter/splitter.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-local-video/video.min.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-github-buttons/plugin.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-ace/ace/ace.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-ace/ace.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-search/search-engine.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-search/search.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-lunr/lunr.min.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-lunr/search-lunr.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-sharing/buttons.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-fontsettings/fontsettings.js"></script>
        
    

    </body>
</html>

